(define (square-tree items)    
    (map 
        (lambda (sub-tree) 
            (if (pair? sub-tree)
                (square-tree sub-tree)
                (* sub-tree sub-tree)
            )
        ) 
        items 
    )
)
(display 
    (square-tree 
        (list 1 (list 2 (list 3 4) 5) (list 6 7))
    )
)
(newline)

(define (square-tree2 items)    
    (define (square-s sub-tree)
        (if (pair? sub-tree)
            (square-tree2 sub-tree)
            (* sub-tree sub-tree)
        )        
    ) 
    (if (null? items)
        `()
        (cons 
            (square-s (car items))
            (square-tree2 (cdr items))
        )    
    )
    
)

(display 
    (square-tree2
        (list 1 (list 2 (list 3 4) 5) (list 6 7))
    )
)
(exit)